<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"  
                xmlns:h="http://java.sun.com/jsf/html"  
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./../templates/StaffTemplate.xhtml">
 
    <ui:define name="logout">
        <p:commandLink id="logoutLink" actionListener="#{staffLogoutManagedBean.doLogout}" value="#{bundle['login.logout.label']}" ajax="false" immediate="true" />
    </ui:define>
 
    <ui:define name="nav_menu">
        <f:view beforePhase="#{staffDeleteAccountManagedBean.initView}" >
            <p:menubar model="#{staffDeleteAccountManagedBean.staffMenuModel}"/>
        </f:view>
    </ui:define>
    
    <ui:define name="content">
        <h:form>
            <p:panel id="staffAccountDetail" header="#{bundle['staff.header.panel']}"  >
                
                <p:messages id="statusMessages" />
                
                <h:outputLabel id="staffUsername" value ="#{bundle['staff.username.label']}" style="font-weight: bold"/>
                <p:inputText id="acctUsername" value="#{staffDeleteAccountManagedBean.accountUsername}" validatorMessage="#{bundle['staffAccount.username.validatorEmailFormat']}"></p:inputText>
                <p:commandButton id="btnSelectAccount" actionListener="#{staffDeleteAccountManagedBean.selectAccount}" value="#{bundle['staff.submit.button']}" update="accountPanel" ajax="true"/>
                <p:message for="email"/>

                <p:tabView id="tabViewTouristView" dynamic="false">

                    <p:tab id="tabTouristAccountInfo" title="#{bundle['staff.accountinfo.tab']}">
                        <h:panelGrid columns="3" cellpadding="5">
                            <h:outputLabel id="staffAccountUsernameLabel" value="#{bundle['staff.username.label']}" style="font-weight: bold"/>
                            <h:outputText id="username" value="#{staffDeleteAccountManagedBean.username}" />
                            <p:message for="username" />

                            <h:outputLabel id="staffAccountCurrentPasswordLabel" value="#{bundle['staff.currentpassword.label']}" style="font-weight: bold"/>
                            <h:outputText id="currpassword" value="******" />
                            <p:message for="currpassword" />

                            <h:outputLabel id="staffAccountLanguageLabel" value="#{bundle['staff.languagepreferred.label']}" style="font-weight: bold"/>
                            <h:outputText id="language" value="#{staffDeleteAccountManagedBean.language}" />
                            <p:message for="language" />
                            
                            <h:outputLabel id="staffAccountEmailLabel" value ="#{bundle['staff.email.label']}" style="font-weight: bold"/>
                            <h:outputText id="email" value="#{staffDeleteAccountManagedBean.email}" />
                            <p:message for="email"/>
                        </h:panelGrid>
                    </p:tab>
                    
                    <p:tab id="tabStaffCorporateInfo" title="#{bundle['staff.corporateinfo.tab']}">
                        <h:panelGrid columns="3" cellpadding="5">

                            <h:outputLabel id="staffAccountDeptLabel" value ="#{bundle['staff.department.label']}" style="font-weight: bold"/>
                            <h:outputText id="dept" value="#{staffDeleteAccountManagedBean.department}" />
                            <p:message for="dept"/>

                            <h:outputLabel id="staffAccountJobPositionLabel" value ="#{bundle['staff.jobposition.label']}" style="font-weight: bold"/>
                            <h:outputText id="jobposition" value="#{staffDeleteAccountManagedBean.jobPosition}" />
                            <p:message for="jobposition"/>

                            <h:outputLabel id="staffAccountJoinDateLabel" value ="#{bundle['staff.joindate.label']}" style="font-weight: bold" />
                            <h:outputText id="joindate" value="#{staffDeleteAccountManagedBean.joinDate}" />
                            <p:message for="joindate"/>

                            <h:outputLabel id="staffAccountAccessLabel" value ="#{bundle['staff.accessrights.label']}" style="font-weight: bold" />
                            <p:dataList id="accessRights" value="#{staffDeleteAccountManagedBean.accessRightsList}" var="accessRight" itemType="square" >             
                                <p:column>
                                    <h:outputText value="#{accessRight}" />
                                </p:column>
                            </p:dataList>
                            <p:message for="accessRights"/>

                        </h:panelGrid>
                    </p:tab>

                    <p:tab id="tabTouristPersonalInfo" title="#{bundle['staff.personalinfo.tab']}">
                        <h:panelGrid  columns="3" cellpadding="5">
                            <h:outputLabel id="staffAccountNameLabel" value="#{bundle['staff.name.label']}" style="font-weight: bold"/>
                            <h:outputText id="name" value="#{staffDeleteAccountManagedBean.name}" />
                            <p:message for="username" />

                            <h:outputLabel id="staffAccountGenderLabel" value="#{bundle['staff.gender.label']}" style="font-weight: bold"/>
                            <h:outputText id="gender" value="#{staffDeleteAccountManagedBean.gender}" />
                            <p:message for="gender"/>

                            <h:outputLabel id="staffAccountBirthdateLabel" value ="#{bundle['staff.birthdate.label']}" style="font-weight: bold"/>
                            <h:outputText id="birthdate" value="#{staffDeleteAccountManagedBean.birthdate}" />
                            <p:message for="birthdate"/>

                            <h:outputLabel id="staffAccountCountryLabel" value ="#{bundle['staff.country.label']}" style="font-weight: bold"/>
                            <h:outputText id="country" value="#{staffDeleteAccountManagedBean.country}" />
                            <p:message for="country"/>

                            <h:outputLabel id="staffAccountEmailSecondaryLabel" value ="#{bundle['staff.emailSecondary.label']}" style="font-weight: bold"/>
                            <h:outputText id="emailSecondary" value="#{staffDeleteAccountManagedBean.emailSecondary}" />
                            <p:message for="emailSecondary"/>
                        </h:panelGrid>
                    </p:tab>

                </p:tabView>

                <br/>
                <p:commandLink id="myFoodsageInactivateButton" value="#{bundle['staff.inactivate.button']}" actionListener="#{staffDeleteAccountManagedBean.sendInactivationRequest}" ajax="false" />
            </p:panel>
        </h:form>
    </ui:define>  
    
</ui:composition>

